<?php
/*
Primary Developer: Alex Arey
Updated: 12/10/2011
Module Description: UserIdentity provides a user identity data object, 
	which can  be stored in a Zend_Auth session.
*/
class Application_Model_UserIdentity
{
    protected $_username;
    protected $_uid;
    protected $_userrank;
    protected $_usertype;

	//constructor initiates all values for the object
    public function __construct($username,$uid,$rank, $type)
    {
	$this->_username = $username;
	$this->_uid = (int)$uid;
	$this->_userrank = (int)$rank;
	$this->_usertype = $type;
    }

	//returns username as a string.
    public function getUserName()
    {
	return $this->_username;
    }
	//returns the user's userid (PK in the USERS table)
    public function getUID()
    {
	return $this->_uid;
    }
	/** 
	* Returns the user's user rank as an integer.
	* 0=> Unregistered User
	* 1=> Registered User
	* >=2 =>Administrative Users
	*/
    public function getUserRank()
    {
	return $this->_userrank;
    }
    
    /**
    * Get user type as one of 'organization', 'teacher', 'student'
    * Admin is designated as a rank, not a type.
    */
    public function getUserType(){
		return $this->_usertype;
    }
	
	/**
	* Get and set user type allows updates independent of login; ie for profile creation.
	*/
	public function setUserType($usertype){
	$this->_usertype = $usertype;
	}
	public function setUserRank($userrank){
	$this->_userrank = $userrank;
	}
	
}
?>

